package org.ddd.orderdemo.application.event.listener;

import com.google.common.eventbus.Subscribe;
import org.ddd.orderdemo.application.event.DomainEvent;
import org.ddd.orderdemo.application.event.subscribe.Subscriber;

public class EventListener implements Subscriber {


    /**
     * 订阅方法必须有且仅有一个参数
     * 必须使用@Subscribe注解
     * 方法需为public
     * @param event
     */
    @Subscribe // 处理方法
    public void onEvent(DomainEvent event) {

        // 复杂业务逻辑
        logger.info("event:{}", event);

    }

}
